package com.tutu.commons.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tutu.commons.checks.AddressSave;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Program: b2c-cloud-store
 * @Description: 用户地址实体类
 * @Author: JK.TuTu
 * @ @Version: 1.0
 * @Create: 2022-12-14 10:53
 **/
@Data
@TableName("address")
public class Address implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;   //地址主键

    @NotBlank(message = "联系人不可为空",groups = {AddressSave.class})
    private String linkman;  //联系人

    @NotBlank(message = "联系号码不可为空",groups = {AddressSave.class})
    private String phone;  //联系号码


    @NotBlank(message = "详细地址不可为空",groups = {AddressSave.class})
    private String address;  //详细地址

    @TableField("user_id")
    @NotNull(message = "用户id不可为空",groups = {AddressSave.class})
    private Integer userId;  //用户主键
}
